/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, {Component} from 'react';
import { StyleSheet, Text, View,TouchableOpacity,NativeModules} from 'react-native';
var RNBridgeModule = NativeModules.RNBridgeModule;

export default class App extends Component {

  enter(){
      // 在线客服
      var domain = '19921839781.udesk.cn';
      var appkey = '2fb59bef317a163ef09c2b286760db15';
      var appID = '9660e6e6e1eaf38a';
      var token = '2ItfeZfYymsrNcA-rLrKKKpd0SN9OFxhENGP6VBuakHiN6VcfikZOmU9abXou2lK'
      RNBridgeModule.RNChatVC(domain,appkey,appID,token);
  }

  render() {
    return (
      <View style={styles.container}>
          <TouchableOpacity  activeOpacity={1} onPress={() => this.enter()}>
              <Text style={styles.welcome}>Udesk在线咨询</Text>
          </TouchableOpacity>
      </View>
    );
  }

}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  }
});
